<script setup>
const changeRouter = (item) => {
  window.location.href = `https://ciyuansj.com/xe/${item}.html`
}

const download = async () => {
  try {
    // 使用window.open直接打开下载链接，绕过CORS限制
    window.open("https://file.lddian.com/app/null/null/5b642b7e-da7a-40ee-b585-76805fd507da.apk");
  } catch (error) {
    console.error('下载失败:', error);
    uni.showToast({
      title: '下载失败，请稍后重试',
      icon: 'none'
    });
  }
}

</script>
<template>
  <div class="iphone_container">
    <div class="header">
      <img src="@/static/tb.png" alt="" />
      <div>
        <h1>灵动点</h1>
        <span>灵动大门已开启，勇士们，准备好了吗</span>
      </div>
    </div>
    <div class="pf">
      <div class="pl_item">
        <div>★ 5.0</div>
        <span>应用评分</span>
      </div>
      <div class="pl_item">
        <div>130万</div>
        <span>下载次数</span>
      </div>
      <div class="pl_item">
        <div>19.01M</div>
        <span>包大小</span>
      </div>
      <div class="pl_item border">
        <div>安全</div>
        <span>应用检测</span>
      </div>
    </div>
    <div class="detail">
      <div class="title">详情</div>
      <div class="imglist">
        <img src="@/static/1.png" alt="" />
        <img src="@/static/2.png" alt="" />
        <img src="@/static/3.png" alt="" />
      </div>
    </div>
    <div class="fino">
      应用简介:欢迎来到次元世界，一个专为二次元爱好者打造的全方位平台!在这里，你可以尽情享受丰富多彩的动漫、漫画资源，参与活跃的社区交流，获取新的二次元资讯，还能发现更多有趣的内容和活动。无论你是资深动漫迷还是新手入门者次元世界都能满足你的二次元梦!
    </div>
    <div class="footer">
      <div>
        <a href="https://ciyuansj.com/xe/yscl.html" @click="changeRouter('ys')">隐私</a>
        <a href="https://ciyuansj.com/xe/qx.html" @click="changeRouter('qx')">权限</a>
        <span>版本1.0.0 |</span>
        <span>太原清风云动有限公司</span>
      </div>
      <a style="color: #656565" href="http://beian.miit.gov.cn/">晋ICP备2024037761号-7A</a>
    </div>
    <div class="btn" @click="download">立即下载</div>
  </div>
</template>

<style lang="scss" scoped>
.iphone_container {
  min-height: 100vh;
  width: 100vw;
  padding: 50rpx;
  padding-bottom: 220rpx;
  background: #242336;
  color: #fff;

  .header {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 24rpx;

    img {
      height: 150rpx;
      width: 150rpx;
      margin-right: 50rpx;
    }

    h1 {
      margin-bottom: 20rpx;
      font-size: 40rpx;
    }
  }

  .pf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 80rpx 0 40rpx;

    .pl_item {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      flex: 1;
      font-size: 28rpx;
      border-left: 4rpx solid #fff;
    }

    div {
      margin-bottom: 10rpx;
      font-size: 26rpx;
    }

    .border {
      border-right: 4rpx solid #fff;
    }
  }

  .detail {
    .title {
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 30rpx;
      margin: 0 auto;
      width: 200rpx;
      border-bottom: 4rpx solid #60b2f1;
      height: 100rpx;
    }

    .imglist {
      display: flex;
      justify-content: space-between;
      margin-top: 50rpx;

      img {
        width: 30%;
        /* 宽度填满分配的空间 */
        height: auto;
        object-fit: contain;
        margin: 0 5rpx;
      }
    }
  }

  .fino {
    font-size: 22rpx;
    margin: 30rpx 0;
    line-height: 60rpx;
  }

  .footer {
    font-size: 24rpx;

    div {
      margin-bottom: 40rpx;
    }

    a {
      margin-right: 40rpx;
      color: #fff;
    }
  }

  .btn {
    position: fixed;
    bottom: 50rpx;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 80rpx;
    background: #5c81ff;
    font-size: 40rpx;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50rpx;
  }
}
</style>
